<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------

namespace app\video\home;
use app\common\controller\AuthCheck;
use think\facade\Debug;
/**
 * 视频类
 * @package app\user\admin
 */
class Video extends AuthCheck
{
    /**
     * 视频详情
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function get_play_info(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id    = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        
        //数据验证
        $Validate = validate('PlayNoUid', 'validate');
        if( !$Validate -> scene('get_play_info') -> check($params) ){
            json_out(-1001, $Validate -> getError(), (object)[]);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_play_info($user_id, $play_id);

        //数据返回
        json_out($list['code'], $list['message'], (object)$list['data']);        
    }
    
	/**
     * 删除视频
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function delete_video_play(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('delete_video_play') -> check($params) ){
            json_out(-1001, $Validate -> getError(), (object)[]);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> delete_video_play($user_id, $play_id);

        //数据返回
        json_out($list['code'], $list['message']);        
    }

    /**
     * 视频评论
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function add_comment(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        $content    = strval(isset($params["content"]) ? $params["content"] : '');
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_comment') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_comment($user_id, $play_id, $content);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '评论成功', $list['data']);
        }else{
            json_out($list['code'], $list['message']);
        }
        
    }

    /**
     * 视频点赞
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function add_support(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('ac_support') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_support($user_id, $play_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '点赞成功');
        }else{
            json_out($list['code'], $list['message']);
        }
    }

    /**
     * 视频取消点赞
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function cancel_support(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('ac_support') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_support($user_id, $play_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '取消点赞成功');
        }else{
            json_out($list['code'], $list['message']);
        }        
    }
	
    /**
     * 视频 评论列表
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function get_comment_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
		$page      = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
		
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_comment_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_comment_list($user_uid, $play_id, $page, $page_size);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }

    /**
     * 视频 评论 回复列表
     * @author jason wang <120907037@qq.com>
     * @return mixed
     */
    public function get_comment_reply_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_comment_reply_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_comment_list($user_id, $play_id);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 查询某人视频
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function others_video_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id   = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);

        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('others_video_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> others_video_list($user_id, $user_uid);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 我收藏的视频
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function collect_video_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id   	= intval(isset($params["user_id"]) ? $params["user_id"] : 0);

        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('collect_video_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> collect_video_list($user_id);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }

	/**
     * 我点赞的视频
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function support_video_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);

        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('support_video_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> support_video_list($user_uid);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
    
	
	/**
     * 视频评论回复
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function add_comment_reply(){
        //参数接收
        $params 		= $this->getParams(1);//0 get 1 post 
        $user_id   		= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $play_id   		= intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        $comment_id   	= intval(isset($params["comment_id"]) ? $params["comment_id"] : 0);
		$r_uid   		= intval(isset($params["r_uid"]) ? $params["r_uid"] : 0);
        $content   		= strval(isset($params["content"]) ? $params["content"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_comment_reply') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_comment_reply($user_id, $play_id, $comment_id, $r_uid, $content);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '回复成功', $list['data']);
        }else{
            json_out($list['code'], '回复失败');
        }
    }
	/**
     * 视频评论回复列表
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function get_reply_list(){
        //参数接收
        $params 		= $this->getParams(0);//0 get 1 post 
        $user_uid   	= intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $comment_id   	= intval(isset($params["comment_id"]) ? $params["comment_id"] : 0);
		$page      = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_reply_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_reply_list($user_uid, $comment_id, $page, $page_size);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 视频评论点赞
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function add_comment_support(){
		//参数接收
        $params 		= $this->getParams(1);//0 get 1 post 
        $user_id   		= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $comment_id   	= intval(isset($params["comment_id"]) ? $params["comment_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('comment_support') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_comment_support($user_id, $comment_id);

        //数据返回
        json_out($list['code'], $list['message']);
		
	}
	
	/**
     * 视频评论取消点赞
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function cancel_comment_support(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    	= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $comment_id     = intval(isset($params["comment_id"]) ? $params["comment_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('comment_support') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_comment_support($user_id, $comment_id);

        //数据返回
        json_out($list['code'], $list['message']);        
    }
	
	/**
     * 视频评论回复点赞
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function add_reply_support(){
		//参数接收
        $params 		= $this->getParams(1);//0 get 1 post 
        $user_id   		= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $reply_id   	= intval(isset($params["reply_id"]) ? $params["reply_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('reply_support') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_reply_support($user_id, $reply_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '点赞成功');
        }else{
            json_out($list['code'], $list['message']);
        }
		
	}
	
	/**
     * 视频评论回复取消点赞
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function cancel_reply_support(){
        //参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $reply_id   = intval(isset($params["reply_id"]) ? $params["reply_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('reply_support') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_reply_support($user_id, $reply_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '取消成功');
        }else{
            json_out($list['code'], $list['message']);
        }
    }
	
	
	/**
     * 我的评论/回复里列表
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
    public function my_comment_reply_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('my_comment_reply_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> my_comment_reply_list($user_id);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 视频举报
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function add_report(){
		//参数接收
        $params = $this->getParams(1);//0 get 1 post 
        $user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $report_id  = intval(isset($params["report_id"]) ? $params["report_id"] : 0);
        $report_type  = intval(isset($params["report_type"]) ? $params["report_type"] : 0);
        $reason  	= intval(isset($params["reason"]) ? $params["reason"] : 0);
        $describe  	= strval(isset($params["describe"]) ? $params["describe"] : '');
        $img_url_1	= strval(isset($params["img_url_1"]) ? $params["img_url_1"] : '');
        $img_url_2	= strval(isset($params["img_url_2"]) ? $params["img_url_2"] : '');
        $img_url_3	= strval(isset($params["img_url_3"]) ? $params["img_url_3"] : '');
        $img_url_4	= strval(isset($params["img_url_4"]) ? $params["img_url_4"] : '');
		
		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_report') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_report($user_id, $report_type, $report_id, $reason, $describe, $img_url_1, $img_url_2, $img_url_3, $img_url_4);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '举报成功');
        }else{
            json_out($list['code'], $list['message']);
        }
	}
	
	/**
     * 视频收藏
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function add_collect(){
		//参数接收
        $params = $this->getParams(1);//0 get 1 post 
		$user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
		$play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
		
		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_collect') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }
		
		 //逻辑处理
        $list = controller('Videologic', 'logic') -> add_collect($user_id, $play_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '收藏成功');
        }else{
            json_out($list['code'], $list['message']);
        }
	}
	
	/**
     * 视频取消收藏
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function cancel_collect(){
		//参数接收
        $params = $this->getParams(1);//0 get 1 post 
		$user_id    = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
		$play_id    = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
		
		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_collect') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }
		
		 //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_collect($user_id, $play_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '取消成功');
        }else{
            json_out($list['code'], $list['message']);
        }
	}
	
	/**
     * 删除视频评论
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function cancel_comment(){
		//参数接收
        $params = $this->getParams(1);//0 get 1 post 
		$user_id    	= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
		$comment_id     = intval(isset($params["comment_id"]) ? $params["comment_id"] : 0);
		
		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('cancel_comment') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }
		
		 //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_comment($user_id, $comment_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '取消成功');
        }else{
            json_out($list['code'], $list['message']);
        }
	}
	
	/**
     * 删除评论回复
     * @author shiqiang <976162041@qq.com>
     * @return mixed
     */
	public function cancel_comment_reply(){
		//参数接收
        $params = $this->getParams(1);//0 get 1 post 
		$user_id    	= intval(isset($params["user_id"]) ? $params["user_id"] : 0);
		$reply_id    	= intval(isset($params["reply_id"]) ? $params["reply_id"] : 0);
		
		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('cancel_comment_reply') -> check($params) ){
            json_out(-1001, $Validate -> getError());//验证失败
        }
		
		 //逻辑处理
        $list = controller('Videologic', 'logic') -> cancel_comment_reply($user_id, $reply_id);

        //数据返回
        if($list['code'] == 200){
            json_out($list['code'], '取消成功');
        }else{
            json_out($list['code'], $list['message']);
        }
    }
    
    /**
     * 关注的视频推送
     * @author baoshi 
     * @return mixed
     */
    public function get_follow_play_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_id   = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $page      = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_follow_play_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_follow_play_list($user_id, $page_size);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }

    /**
     * 首页短视频推送
     * @author baoshi 
     * @return mixed
     */
    public function get_push_play_list(){
        Debug::remark('begin');
        
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $class_id   = intval(isset($params["class_id"]) ? $params["class_id"] : 0);
        $page       = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size       = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_push_play_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_push_play_list($user_uid,$page, $page_size, $class_id);
        Debug::remark('end');
        //echo Debug::getRangeTime('begin','end').'s';    
        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
        
    }

    /**
     * 首页短视频推送
     * @author baoshi 
     * @return mixed
     */
    public function get_push_play_list_type3(){
        Debug::remark('begin');
        
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $page       = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size       = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_push_play_list_type3') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_push_play_list_type3($user_uid,$page, $page_size);
        Debug::remark('end');
        //echo Debug::getRangeTime('begin','end').'s';    
        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
        
    }

    /**
     * 首页 长视频推送
     * @author baoshi 
     * @return mixed
     */
    public function get_push_play_long_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $class_id   = intval(isset($params["class_id"]) ? $params["class_id"] : 0);
        $page       = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size       = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_push_play_long_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_push_play_long_list($user_uid, $page, $page_size, $class_id);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
    
    /**
     * 视频搜索 列表
     * @author baoshi 
     * @return mixed
     */
    public function get_play_list_search(){
        Debug::remark('begin');
        
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $user_uid   = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $video_title   = isset($params["video_title"]) ? $params["video_title"] : '';
        $video_type   = intval(isset($params["video_type"]) ? $params["video_type"] : 0);
        $page       = intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size       = intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_play_list_search') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_play_list_search($user_uid, $video_title, $video_type);
        Debug::remark('end');
        //echo Debug::getRangeTime('begin','end').'s';    
        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
        
    }

	/**
     * 视频分类查询
     * @author shqiiang 
     * @return mixed
     */
    public function get_video_class(){
        
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 

        
        //数据验证
       /*  $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_video_class') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        } */

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_video_class();

        //数据返回
        json_out($list['code'], $list['message'], $list['data']); 
          
    }

    /**
     * 视频分类查询
     * @author shqiiang 
     * @return mixed
     */
    public function get_video_class_level1(){
        
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 

        
        //数据验证
       /*  $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_video_class') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        } */

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_video_class_level1();

        //数据返回
        json_out($list['code'], $list['message'], $list['data']); 
          
    }
	
	/**
     * 视频分类标签查询
     * @author shqiiang 
     * @return mixed
     */
    public function get_video_class_label(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
        $pid   = intval(isset($params["pid"]) ? $params["pid"] : '');
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_video_class_label') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_video_class_label($pid);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 短视频相关推荐
     * @author shiqiang 
     * @return mixed
     */
    public function get_short_label_play_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
		$user_uid   	= intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $page   		= intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size   	= intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_short_label_play_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_short_label_play_list($user_uid, $page, $page_size);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	/**
     * 标签相关视频
     * @author baoshi 
     * @return mixed
     */
    public function get_push_label_play_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
		$user_uid   	= intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $play_id   		= intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        $play_type   	= intval(isset($params["play_type"]) ? $params["play_type"] : 0);
        $page   		= intval(isset($params["page"]) ? $params["page"] : 1);
        $page_size   	= intval(isset($params["page_size"]) ? $params["page_size"] : 10);
        
        //数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('get_push_label_play_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> get_push_label_play_list($user_uid, $play_id, $play_type, $page, $page_size);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }

    /**
     * 我的视频列表
     * @author baoshi 
     * @return mixed
     */
    public function mymcn_video_list(){
        //参数接收
        $params = $this->getParams(0);//0 get 1 post 
		$user_id   = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
        $state   = strval(isset($params["state"]) ? $params["state"] : '');
        //数据验证
        /* $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('mymcn_video_list') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        } */

        //逻辑处理
        $list = controller('Videologic', 'logic') -> mymcn_video_list($user_id, $state);

        //数据返回
        json_out($list['code'], $list['message'], $list['data']);        
    }
	
	 /**
     * 用户观看视频时间
     * @author shiqiang 
     * @return mixed
     */
	public function add_play_watchcount(){
		 //参数接收
        $params = $this->getParams(1);//0 get 1 post 
		$user_uid  = intval(isset($params["user_uid"]) ? $params["user_uid"] : 0);
        $play_id   = intval(isset($params["play_id"]) ? $params["play_id"] : 0);
        $seconds   = intval(isset($params["seconds"]) ? $params["seconds"] : 0);

		//数据验证
        $Validate = validate('Play', 'validate');
        if( !$Validate -> scene('add_play_watchcount') -> check($params) ){
            json_out(-1001, $Validate -> getError(), []);//验证失败
        }

        //逻辑处理
        $list = controller('Videologic', 'logic') -> add_play_watchcount($user_uid, $play_id, $seconds);

        //数据返回
        json_out($list['code'], $list['message']);        
	}
	
	/**
     * 视频举报类型获取
     * @author shiqiang
     * @return mixed
     */
	public function play_report_list(){
		//参数接收
        $params = $this->getParams(0);//0 get 1 post 
		// $user_id  = intval(isset($params["user_id"]) ? $params["user_id"] : 0);
		
		// 数据验证
        // $Validate = validate('Play', 'validate');
        // if( !$Validate -> scene('report_list') -> check($params) ){
            // json_out(-1001, $Validate -> getError(), []);//验证失败
        // }
		
		//逻辑处理
        $list = controller('Videologic', 'logic') -> play_report_list();
		
		//数据返回
        json_out($list['code'], $list['message'], $list['data']);        
	}
}
